package TAIC.test;

import TAIC.util.GenImageModel;

public class Feature_Tuning_TestMode extends TestMode {
	GenImageModel genModel ;

	public Feature_Tuning_TestMode ( ) throws Exception {
		genModel = new GenImageModel ( "..\\WordImageDict.txt" );
	}

	public int loop1Begin () {
		return para.getParaInt( "Per_Begin" ) ; 
	}

	public int loop1End () {
		return para.getParaInt( "Per_End" ) ; 		
	}
	
	public int loop2Begin () {
		return 1;  		
	}
	
	public int loop2End () {
		return 1 ;  		
	}
	
	public TestResult test ( DataGen dataGen , int percentage , int BaseImage ) {
		outputImageModel ( percentage ) ; 
		return dataGen.test( 0 , para.getParaInt( "BaseImage_Begin" ) , para.getParaInt( "Key" ) , 
				para.getParaInt( "TestImage"), para.getParaInt( "Iteration" ) ,
				Math.pow(2.0, para.getParaInt( "Lambda" )) , "" ) ;
	}
	
	private void outputImageModel ( int percentage ){
		try {
			genModel.GenOne( "model.txt", "ImageModel.txt", percentage); 
		}
		catch ( Exception e ) {
			e.printStackTrace () ;
			System.exit(0);  
		}
	}	
}
